<script>
  import Category from "./components/Category.vue";
  export default {
    name: "App",
    data() {
      return {
        foods:['火锅','烧烤','小龙虾','牛排'],
        games:['红色警戒','穿越火线','劲舞团','超级玛丽'],
        films:['《教父》','《拆弹专家》','《你好，李焕英》','《尚硅谷》']
      }
    },
    components: {
      Category,
    },
    mounted() {
      console.log("Component App:", this.$bus);
    }
  }
</script>

<template>
  <div id="root">
    <Category title="美食">
      <!-- 具名插槽缩写 -->
      <template v-slot:s1>
        <img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage109.360doc.com%2FDownloadImg%2F2024%2F12%2F2521%2F292396352_2_20241225091719502.jpeg&refer=http%3A%2F%2Fimage109.360doc.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1761881991&t=32e9b8a9e98166b047c117a42e9e822e" />
      </template>
      <template v-slot:s2>
        <div class="footer">
          <a href="#">更多美食</a>
        </div>
      </template>
    </Category>
    <Category title="游戏">
      <template #s1>
        <ul>
          <li v-for="(g, index) in games" :key="index">{{g}}</li>
        </ul>
      </template>
      <template #s2>
        <div class="footer">
          <a href="#">单机游戏</a>
          <a href="#">网络游戏</a>
        </div>
      </template>
    </Category>
    <Category title="电影">
      <template #s1>
        <video controls src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
      </template>
      <template #s2>
        <div class="footer">
          <a href="#">科技</a>
          <a href="#">动漫</a>
          <a href="#">悬疑</a>
        </div>
      </template>
    </Category>
  </div>
</template>

<style>
 #root {
   padding: 20px;
   display: flex;
   justify-content: space-around;
 }
 img {
   width: 100%;
 }
 .footer {
   display: flex;
   justify-content: space-around;
   text-align: center;
 }
</style>